// File TerroristStates.h
//
// Purpose: Contains the states for the terrorist AI
//
// Author : Bryson King (edited)
// Original Code Provided by: Mat Buckland 2002 (fup@ai-junkie.com)
// Date : 18 March 2013
// --------------------------------------------------------------
#ifndef TERRORISTSTATES_H
#define TERRORISTSTATES_H

#define DEBUG_SECTION

#include "AbstractState.h"

class CTerrorist;
struct Telegram;

//------------------------------------------------------------------------
//
//  In this state the miner will walk to a goldmine and pick up a nugget
//  of gold. If the miner already has a nugget of gold he'll change state
//  to VisitBankAndDepositGold. If he gets thirsty he'll change state
//  to QuenchThirst
//------------------------------------------------------------------------
class Attack : public CState<CTerrorist>
{
private:  
	Attack(){}

	//copy ctor and assignment should be private
	Attack(const Attack&);
	Attack& operator=(const Attack&);
 
public:
	//this is a singleton
	static Attack* Instance();

	virtual void Enter(CTerrorist* terrorist);

	virtual void Execute(CTerrorist* terrorist);

	virtual void Exit(CTerrorist* terrorist);

	virtual bool OnMessage(CTerrorist* agent, const Telegram& msg);
};

//------------------------------------------------------------------------
//
//  Entity will go to a bank and deposit any nuggets he is carrying. If the 
//  miner is subsequently wealthy enough he'll walk home, otherwise he'll
//  keep going to get more gold
//------------------------------------------------------------------------
class RunAway : public CState<CTerrorist>
{
private:
	RunAway(){}

	//copy ctor and assignment should be private
	RunAway(const RunAway&);
	RunAway& operator=(const RunAway&);
 
public:
	//this is a singleton
	static RunAway* Instance();

	virtual void Enter(CTerrorist* terrorist);

	virtual void Execute(CTerrorist* terrorist);

	virtual void Exit(CTerrorist* terrorist);

	virtual bool OnMessage(CTerrorist* agent, const Telegram& msg);
};

//------------------------------------------------------------------------
//
//  miner will go home and sleep until his fatigue is decreased
//  sufficiently
//------------------------------------------------------------------------
class ProceedTowardBridge : public CState<CTerrorist>
{
private:  
	ProceedTowardBridge(){}

	//copy ctor and assignment should be private
	ProceedTowardBridge(const ProceedTowardBridge&);
	ProceedTowardBridge& operator=(const ProceedTowardBridge&);
 
public:
	//this is a singleton
	static ProceedTowardBridge* Instance();

	virtual void Enter(CTerrorist* terrorist);

	virtual void Execute(CTerrorist* terrorist);

	virtual void Exit(CTerrorist* terrorist);

	virtual bool OnMessage(CTerrorist* agent, const Telegram& msg);
};

//------------------------------------------------------------------------
//
//  miner changes location to the saloon and keeps buying Whiskey until
//  his thirst is quenched. When satisfied he returns to the goldmine
//  and resumes his quest for nuggets.
//------------------------------------------------------------------------
class Hide : public CState<CTerrorist>
{
private:
	Hide(){}

	//copy ctor and assignment should be private
	Hide(const Hide&);
	Hide& operator=(const Hide&);
 
public:
	//this is a singleton
	static Hide* Instance();

	virtual void Enter(CTerrorist* terrorist);

	virtual void Execute(CTerrorist* terrorist);

	virtual void Exit(CTerrorist* terrorist);

	virtual bool OnMessage(CTerrorist* agent, const Telegram& msg);
};

//------------------------------------------------------------------------
//
//  this is implemented as a state blip. The miner eats the stew, gives
//  Elsa some compliments and then returns to his previous state
//------------------------------------------------------------------------
class Hijack : public CState<CTerrorist>
{
private:
	Hijack(){}

	//copy ctor and assignment should be private
	Hijack(const Hijack&);
	Hijack& operator=(const Hijack&);

public:
	//this is a singleton
	static Hijack* Instance();

	virtual void Enter(CTerrorist* terrorist);

	virtual void Execute(CTerrorist* terrorist);

	virtual void Exit(CTerrorist* terrorist);

	virtual bool OnMessage(CTerrorist* agent, const Telegram& msg);
};

#endif